package com.guli.edu.controller;

import com.guli.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: EduLoginController 
 * @Description: TODO
 * @author: liuzg
 * @Date: 2021/2/22 14:46
 * @Version: v1.0
 */
// 解决前端调用跨域问题(协议、ip、端口号各不同都会出现跨域问题)
@RestController
@RequestMapping("/edu/user")
@Api(tags = "登录")
public class EduLoginController {


    @ApiOperation(value = "登录")
    @PostMapping(value = "/login")
    public R login(){

        return R.ok().data("token","admin");
    }


    @ApiOperation(value = "用户信息")
    @GetMapping(value = "/info")
    public R info(){

        return R.ok().data("roles","[admin]").data("name","[admin]").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }

}
